<?php
namespace Api\Controller;

class ConfigController extends CommonController {
	//获取配置信息
	public function info(){
		$type   = $this->_get('type');
		$config = array();

		if($type){
			$where['type'] = $type;
		}
		$where['status'] = 1;
		$list = D('Config')->where($where)->select();
		foreach ($list as $rs) {
			$config[$rs['type']][$rs['name']] = trim($rs['val']);
		}
		$this->success('获取数据成功！', $config);
	}
}